import dayjs from 'dayjs'

export function getDaterangeValue(date: string[] | string, index: number) {
  if (Array.isArray(date)) {
    return date[index]
  }
  return date
}

export function getFormatDate(date: string = new Date().toString(), format: string = 'YYYY-MM-DD') {
  return dayjs(date).format(format)
}
